package com.example.urltovoice.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.urltovoice.mapper.DatabaseMapper;
import com.example.urltovoice.pojo.Url;
import com.example.urltovoice.service.DatabaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DatabaseServiceImpl implements DatabaseService {
    @Autowired
    DatabaseMapper databaseMapper;
    @Override
    public int InsertDatabase(Url url) {
        return databaseMapper.insert(url);

    }

    @Override
    public Url SelectDatabase(String url) {
        QueryWrapper<Url> queryWrapper = new QueryWrapper<Url>();
        queryWrapper.eq("url",url);
        return databaseMapper.selectOne(queryWrapper);
    }
}
